<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenMesh: Compiling OpenMesh</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="logo_align.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="rwth_vci_rgb.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenMesh
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a04315.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Compiling <a class="el" href="a01233.html" title="Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...">OpenMesh</a> </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="compilers"></a>
Tested compilers</h1>
<p>OpenMesh has been successfully tested for the following operating systems / compilers. This is only a list of tested compilers. More might be supported but are not tested. Make sure that your compiler supports at least C++11</p>
<table class="doxtable">
<tr>
<td>Linux </td><td><p class="starttd">gcc &gt;= 6.3<br />
 clang &gt;= 3.3<br />
 </p>
<p class="endtd"></p>
</td></tr>
<tr>
<td>Windows </td><td><p class="starttd">Microsoft Visual Studio 2015<br />
 Microsoft Visual Studio 2017<br />
 </p>
<p class="endtd"></p>
</td></tr>
<tr>
<td>Tested MacOS X Compilers </td><td><p class="starttd">XCode <br />
 </p>
<p class="endtd"></p>
</td></tr>
</table>
<h1><a class="anchor" id="req_libs"></a>
Required libraries (Only if you want to build the included Apps)</h1>
<p>Install the following external libraries / frameworks if you want to use the included Applications:<br />
<br />
 </p><table class="doxtable">
<tr>
<td>Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">https://www.qt.io/download</a> </td></tr>
</table>
<p><br />
</p>
<h1><a class="anchor" id="build_systems"></a>
Chosing build system</h1>
<p>OpenMesh can be built using the <b>cmake</b> build system. <br />
 <br />
</p>
<h1><a class="anchor" id="sec_compiling_unix"></a>
Unix</h1>
<h2><a class="anchor" id="linux_using_cmake"></a>
Compiling OpenMesh using CMake</h2>
<p>In order to compile OpenMesh, create a directory named e.g. "build" in <a class="el" href="a01233.html" title="Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...">OpenMesh</a>'s root directory. <b>Change to the newly created directory</b> and type <br />
<br />
 <code> cmake&#160;..&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Generates the appropriate Makefiles<br />
 make&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Builds the project<br />
 </code><br />
</p>
<dl class="section warning"><dt>Warning</dt><dd>If your compiler does not support c++11 natively, you might have to enable it by changing the cmake call to: <br />
 <code>cmake .. -DCMAKE_CXX_FLAGS=-std=c++98</code></dd></dl>
<p>You can choose the build type by using cmake with the flag<br />
 <b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b> The default is: Release <br />
</p>
<p>Other flags are:<br />
 <b>-DBUILD_APPS=OFF</b> to disable build of applications and<br />
 <b>-DCMAKE_INSTALL_PREFIX=&lt;path&gt;</b> to specify the install path.<br />
</p>
<p>When calling <b>make install</b> cmake will install OpenMesh into this directory using the subdirectories lib/include/bin.</p>
<p>CMake builds both shared and static under Linux.</p>
<p>Everything will then be build in the <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.</p>
<p>There are some additional targets:<br />
 <b>doc</b>: Builds the Documentation<br />
 <b>doc-install</b>: Builds the Documentation and installs it<br />
 <br />
 </p><dl class="section note"><dt>Note</dt><dd>When you link against the static libraries of <a class="el" href="a01233.html" title="Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...">OpenMesh</a> and get the error "can not be used when making a
shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)</dd></dl>
<h1><a class="anchor" id="sec_compiling_windows"></a>
Windows</h1>
<h2><a class="anchor" id="windows_using_cmake"></a>
Compiling OpenMesh using CMake</h2>
<p>Building <a class="el" href="a01233.html" title="Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...">OpenMesh</a> on Windows requires cmake to generate the project files for Visual Studio.</p>
<ul>
<li>
Get Visual Studio ( 2015-2017 )  </li>
<li>
Extract OpenMesh source code.  </li>
<li>
Get all required libraries and install them ( including headers! ). </li>
<li>
Download and install cmake: <a href="https://cmake.org/download/">www.cmake.org</a>.<br />
  </li>
<li>
Start the cmake gui and open the OpenMesh toplevel directory as source directory  </li>
<li>
Choose a build directory (e.g. create a directory called "build" in <a class="el" href="a01233.html" title="Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...">OpenMesh</a>'s root folder)  </li>
<li>
Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly. <br />
 Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013) (Depending on your version) as generator.  </li>
<li>
Click generate to create the visual studio project files  </li>
<li>
You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake  </li>
<li>
Now you can build OpenMesh from within Visual Studio using the newly created project file.  </li>
</ul>
<p><br />
 <br />
</p>
<h1><a class="anchor" id="sec_compiling_macosx"></a>
MacOS X</h1>
<p>Download and install required libraries as stated above. You can download OpenMesh's sources from <code>www.openmesh.org</code> or check out the latest repository via GIT:<br />
 <code><a href="https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh">https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh</a></code>.<br />
<br />
</p>
<h2><a class="anchor" id="mac_using_cmake"></a>
Compiling OpenMesh using CMake</h2>
<p>We recommend you to use CMake &gt;= 3.7 as build system. This can also easily be installed via MacPorts as well as the Qt &gt;= 5.6 library which is used for some example applications in OpenMesh.<br />
 Once installed, change to OpenMesh's root directory and create a directory named e.g. "buildDebug" (assuming you want to build with debug symbols).<br />
 Then type in the following command to initially set up the build environment: <br />
<br />
 <code> cmake&#160;..&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Generates the appropriate Makefiles<br />
 </code> <br />
 Note: If the build directory is not a subdirectory of OpenMesh's root folder, replace ".." with OpenMesh's absolute (or relative) path. In order to manually set specific build variables, just type: <br />
<br />
 <code> ccmake&#160;.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Configure build environment<br />
 </code> <br />
 This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build for release configuration. Now, when everything is set up, just type: <br />
<br />
 <code> make&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Build OpenMesh<br />
 </code> <br />
 And optionally: <br />
<br />
 <code> make&#160;doc&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;## Build OpenMesh's documentation<br />
 </code> <br />
 The mac application bundle will be found under "Build" in the recently created build folder. It automatically contains all needed shared objects (libs, fonts, textures, etc.).</p>
<p>CMake builds both shared and static under MacOS X. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<hr>
<address>
<small>
<a href="http://www.rwth-graphics.de" style="text-decoration:none;">
</a>
Project <b>OpenMesh</b>, 
&copy;&nbsp; Computer Graphics Group, RWTH Aachen.
Documentation generated using 
<a class="el" href="http://www.doxygen.org/index.html">
<b>doxygen</b>
</a>.
</small>
</address>
</body>
</html>
